<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*,java.util.* "  errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%@ page import="conn.*" %>
<title>管理员身份验证页面</title>
</head>

<body>
<%
String strName = request.getParameter("username");
String strPassword = request.getParameter("password");
//out.print(strName);
//out.print(strPassword);

Data data=new Data();
Show show=new Show();
int intT=0;
if(strName!=null||strPassword!=null)
{
	
	intT=data.getRowCount("tb_admin where name='"+strName+"' and password='"+strPassword+"'"); 
	//System.out.print("intT:"+intT);
	//intT=data.getRowCount("tb_admin where name='yang' and password='123'"); 
	//name 原名称是admin
	if(intT>0)
	{
		session.setAttribute("name",strName);
		response.sendRedirect("adminIndex.jsp");	
	}
	else {
		
		out.print(show.errorBox("请检查你的用户名和密码","验证信息"));
		return ;
		
		
		}
}else
{
out.print(show.errorBox("请检查数据!","验证信息"));
return ;

}





%>
</body>
</html>